function create_updated_collection(collection_a, object_b) {
  let object={};
  let arr=[];
  for(let item of collection_a){
    if(!object[item]){
      object[item]={};
      object[item].key=item;
      object[item].count=1;
    }
    else {
      object[item].count++;
    }
  }
  for(let a in object){
    arr.push(object[a]);
  }
  for(let i of object_b['value']){
    for(let j of arr){
      if(i===j.key){
        j.count-=parseInt(j.count/3);
      }
    }
  }
  return arr;
}

module.exports = create_updated_collection;
